from selenium import webdriver
from selenium.webdriver.common.by import By
import time

# 1.打开浏览器
driver = webdriver.Chrome()

# 2.输入ecshop网址搜索首页
driver.get('https://ecshop.test2.shopex123.com')

# 3.获取搜索框输入关键字-眼影
time.sleep(2)
kw = driver.find_element(By.ID, 'keyword')
kw.send_keys('眼影')

# 4.获取搜索按钮并点击
driver.find_element(By.CLASS_NAME, 'btn_search').click()

# 退出浏览器
time.sleep(2)
driver.quit()